package com.chats.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * 信息实体类
 */
@Data
public class Message {

    @JsonSerialize(using = ToStringSerializer.class)
    Long id;

    @JsonSerialize(using = ToStringSerializer.class)
    private Long fromId; // 发送人id

    @JsonSerialize(using = ToStringSerializer.class)
    private Long toId; // 接收人id

    private String msg; // 内容

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime time; // 时间

}
